package MathHomeWorkTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/*
求数的每一位
 */
public class MathTest25 {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        List list = new ArrayList();
        while(n != 0){
            int num = n % 10;
            list.add(num);
            n = n / 10;
        }
        for(int i = list.size() - 1; i >= 0; i--){
            System.out.print(list.get(i)+" ");
        }
    }
}
